home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / ADO Public225377102001.psc / frmPhonebookDetails.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-07-11  |  11.9 KB  |  378 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPhonebookDetails 
  3.    BackColor       =   &H00C00000&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Phonebook Details"
  6.    ClientHeight    =   4575
  7.    ClientLeft      =   2910
  8.    ClientTop       =   1815
  9.    ClientWidth     =   4440
  10.    BeginProperty Font 
  11.       Name            =   "Tahoma"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "frmPhonebookDetails.frx":0000
  20.    KeyPreview      =   -1  'True
  21.    LinkTopic       =   "Form1"
  22.    LockControls    =   -1  'True
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   4575
  26.    ScaleWidth      =   4440
  27.    Begin VB.TextBox PrimaryKey 
  28.       Height          =   315
  29.       Left            =   120
  30.       TabIndex        =   18
  31.       Top             =   4080
  32.       Visible         =   0   'False
  33.       Width           =   735
  34.    End
  35.    Begin VB.TextBox txtMobilePhoneNumber 
  36.       BackColor       =   &H00FFFFFF&
  37.       DataField       =   "strCitizenshipDesc"
  38.       DataSource      =   "Data1"
  39.       Height          =   315
  40.       IMEMode         =   3  'DISABLE
  41.       Left            =   1515
  42.       TabIndex        =   6
  43.       Top             =   3240
  44.       Width           =   2775
  45.    End
  46.    Begin VB.TextBox txtEMail 
  47.       BackColor       =   &H00FFFFFF&
  48.       DataField       =   "strCitizenshipDesc"
  49.       DataSource      =   "Data1"
  50.       BeginProperty Font 
  51.          Name            =   "Tahoma"
  52.          Size            =   8.25
  53.          Charset         =   0
  54.          Weight          =   400
  55.          Underline       =   -1  'True
  56.          Italic          =   0   'False
  57.          Strikethrough   =   0   'False
  58.       EndProperty
  59.       ForeColor       =   &H00FF0000&
  60.       Height          =   315
  61.       IMEMode         =   3  'DISABLE
  62.       Left            =   1515
  63.       TabIndex        =   7
  64.       Top             =   3675
  65.       Width           =   2775
  66.    End
  67.    Begin VB.TextBox txtFaxNo 
  68.       BackColor       =   &H00FFFFFF&
  69.       DataField       =   "strCitizenshipDesc"
  70.       DataSource      =   "Data1"
  71.       Height          =   315
  72.       IMEMode         =   3  'DISABLE
  73.       Left            =   1515
  74.       TabIndex        =   5
  75.       Top             =   2820
  76.       Width           =   2775
  77.    End
  78.    Begin VB.TextBox txtAddress 
  79.       BackColor       =   &H00FFFFFF&
  80.       DataField       =   "strCitizenshipDesc"
  81.       DataSource      =   "Data1"
  82.       Height          =   900
  83.       IMEMode         =   3  'DISABLE
  84.       Left            =   1515
  85.       TabIndex        =   3
  86.       Top             =   1395
  87.       Width           =   2775
  88.    End
  89.    Begin VB.CommandButton cmdCancel 
  90.       Caption         =   "&Cancel"
  91.       Height          =   375
  92.       Left            =   3285
  93.       TabIndex        =   9
  94.       Top             =   4110
  95.       Width           =   975
  96.    End
  97.    Begin VB.CommandButton cmdOK 
  98.       Caption         =   "&OK"
  99.       Default         =   -1  'True
  100.       Height          =   375
  101.       Left            =   2235
  102.       TabIndex        =   8
  103.       Top             =   4110
  104.       Width           =   975
  105.    End
  106.    Begin VB.TextBox txtLastName 
  107.       BackColor       =   &H00FFFFFF&
  108.       DataField       =   "strCitizenshipDesc"
  109.       DataSource      =   "Data1"
  110.       Height          =   315
  111.       Left            =   1515
  112.       TabIndex        =   0
  113.       Top             =   165
  114.       Width           =   2775
  115.    End
  116.    Begin VB.TextBox txtMiddleName 
  117.       BackColor       =   &H00FFFFFF&
  118.       DataField       =   "strCitizenshipDesc"
  119.       DataSource      =   "Data1"
  120.       Height          =   315
  121.       Left            =   1515
  122.       TabIndex        =   2
  123.       Top             =   975
  124.       Width           =   2775
  125.    End
  126.    Begin VB.TextBox txtTelNo 
  127.       BackColor       =   &H00FFFFFF&
  128.       DataField       =   "strCitizenshipDesc"
  129.       DataSource      =   "Data1"
  130.       Height          =   315
  131.       IMEMode         =   3  'DISABLE
  132.       Left            =   1515
  133.       TabIndex        =   4
  134.       Top             =   2400
  135.       Width           =   2775
  136.    End
  137.    Begin VB.TextBox txtFirstName 
  138.       BackColor       =   &H00FFFFFF&
  139.       DataField       =   "strCitizenshipDesc"
  140.       DataSource      =   "Data1"
  141.       Height          =   315
  142.       Left            =   1515
  143.       TabIndex        =   1
  144.       Top             =   555
  145.       Width           =   2775
  146.    End
  147.    Begin VB.Label lblLabels 
  148.       BackColor       =   &H00C00000&
  149.       Caption         =   "Cellular #"
  150.       BeginProperty Font 
  151.          Name            =   "Arial"
  152.          Size            =   8.25
  153.          Charset         =   0
  154.          Weight          =   700
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       ForeColor       =   &H00FFFFFF&
  160.       Height          =   255
  161.       Index           =   7
  162.       Left            =   180
  163.       TabIndex        =   17
  164.       Top             =   3240
  165.       Width           =   1320
  166.    End
  167.    Begin VB.Label lblLabels 
  168.       BackColor       =   &H00C00000&
  169.       Caption         =   "E-Mail Address"
  170.       BeginProperty Font 
  171.          Name            =   "Arial"
  172.          Size            =   8.25
  173.          Charset         =   0
  174.          Weight          =   700
  175.          Underline       =   0   'False
  176.          Italic          =   0   'False
  177.          Strikethrough   =   0   'False
  178.       EndProperty
  179.       ForeColor       =   &H00FFFFFF&
  180.       Height          =   255
  181.       Index           =   6
  182.       Left            =   180
  183.       TabIndex        =   16
  184.       Top             =   3675
  185.       Width           =   1320
  186.    End
  187.    Begin VB.Label lblLabels 
  188.       BackColor       =   &H00C00000&
  189.       Caption         =   "Fax Number"
  190.       BeginProperty Font 
  191.          Name            =   "Arial"
  192.          Size            =   8.25
  193.          Charset         =   0
  194.          Weight          =   700
  195.          Underline       =   0   'False
  196.          Italic          =   0   'False
  197.          Strikethrough   =   0   'False
  198.       EndProperty
  199.       ForeColor       =   &H00FFFFFF&
  200.       Height          =   255
  201.       Index           =   5
  202.       Left            =   180
  203.       TabIndex        =   15
  204.       Top             =   2820
  205.       Width           =   1200
  206.    End
  207.    Begin VB.Label lblLabels 
  208.       BackColor       =   &H00C00000&
  209.       Caption         =   "Address"
  210.       BeginProperty Font 
  211.          Name            =   "Arial"
  212.          Size            =   8.25
  213.          Charset         =   0
  214.          Weight          =   700
  215.          Underline       =   0   'False
  216.          Italic          =   0   'False
  217.          Strikethrough   =   0   'False
  218.       EndProperty
  219.       ForeColor       =   &H00FFFFFF&
  220.       Height          =   255
  221.       Index           =   4
  222.       Left            =   180
  223.       TabIndex        =   14
  224.       Top             =   1425
  225.       Width           =   1200
  226.    End
  227.    Begin VB.Label lblLabels 
  228.       BackColor       =   &H00C00000&
  229.       Caption         =   "Middle Name"
  230.       BeginProperty Font 
  231.          Name            =   "Arial"
  232.          Size            =   8.25
  233.          Charset         =   0
  234.          Weight          =   700
  235.          Underline       =   0   'False
  236.          Italic          =   0   'False
  237.          Strikethrough   =   0   'False
  238.       EndProperty
  239.       ForeColor       =   &H00FFFFFF&
  240.       Height          =   255
  241.       Index           =   0
  242.       Left            =   180
  243.       TabIndex        =   13
  244.       Top             =   960
  245.       Width           =   1200
  246.    End
  247.    Begin VB.Label lblLabels 
  248.       BackColor       =   &H00C00000&
  249.       Caption         =   "Last Name"
  250.       BeginProperty Font 
  251.          Name            =   "Arial"
  252.          Size            =   8.25
  253.          Charset         =   0
  254.          Weight          =   700
  255.          Underline       =   0   'False
  256.          Italic          =   0   'False
  257.          Strikethrough   =   0   'False
  258.       EndProperty
  259.       ForeColor       =   &H00FFFFFF&
  260.       Height          =   255
  261.       Index           =   1
  262.       Left            =   180
  263.       TabIndex        =   12
  264.       Top             =   180
  265.       Width           =   1200
  266.    End
  267.    Begin VB.Label lblLabels 
  268.       BackColor       =   &H00C00000&
  269.       Caption         =   "Telephone #"
  270.       BeginProperty Font 
  271.          Name            =   "Arial"
  272.          Size            =   8.25
  273.          Charset         =   0
  274.          Weight          =   700
  275.          Underline       =   0   'False
  276.          Italic          =   0   'False
  277.          Strikethrough   =   0   'False
  278.       EndProperty
  279.       ForeColor       =   &H00FFFFFF&
  280.       Height          =   255
  281.       Index           =   2
  282.       Left            =   180
  283.       TabIndex        =   11
  284.       Top             =   2400
  285.       Width           =   1200
  286.    End
  287.    Begin VB.Label lblLabels 
  288.       BackColor       =   &H00C00000&
  289.       Caption         =   "First Name"
  290.       BeginProperty Font 
  291.          Name            =   "Arial"
  292.          Size            =   8.25
  293.          Charset         =   0
  294.          Weight          =   700
  295.          Underline       =   0   'False
  296.          Italic          =   0   'False
  297.          Strikethrough   =   0   'False
  298.       EndProperty
  299.       ForeColor       =   &H00FFFFFF&
  300.       Height          =   255
  301.       Index           =   3
  302.       Left            =   180
  303.       TabIndex        =   10
  304.       Top             =   585
  305.       Width           =   1200
  306.    End
  307. Attribute VB_Name = "frmPhonebookDetails"
  308. Attribute VB_GlobalNameSpace = False
  309. Attribute VB_Creatable = False
  310. Attribute VB_PredeclaredId = True
  311. Attribute VB_Exposed = False
  312. 'Module by  Raymond Tan Chiu
  313. 'For your comments and suggestions you can conntact me at:
  314. '           raymondchiu@eudoramail.com
  315. '           rchiu@unionbankph.com
  316. '           raymondchiu@edsamail.com.ph
  317. '           (63)(917)376-1894
  318. '           (63)(032)340-8471
  319. '           (63)(032)254-7500
  320. 'Development Date   : 06-19-2001
  321. 'Description        : Shows a ADO data control binds with datagrid.  And a global connection of ADO
  322. 'Components         : Datagrid, Adodc(ADO Data Control), Datagrid
  323. Public mblnAddmode As Boolean
  324. Public mblnUpdated As Boolean
  325. Public mstrLastName As String
  326. Public mstrFirstName As String
  327. Public mstrMiddleName As String
  328. Public mstrAddress As String
  329. Public mstrTelNo As String
  330. Public mstrCellNo As String
  331. Public mstrFaxNo As String
  332. Public mstrEmail As String
  333. Public mstrPrimaryKey As String
  334. Public Sub IncrementRecord()
  335. Dim Rs As ADODB.Recordset
  336. Dim strSQL As String
  337. strSQL = "SELECT ContactID FROM tblPhonebook ORDER BY ContactID DESC"
  338. Set Rs = gadoConn.Execute(strSQL)
  339. If Not Rs.EOF Then
  340.     Me.PrimaryKey = Format(Rs!ContactID + 1, "0000")
  341.     Me.PrimaryKey = Format(1001, "0000")
  342. End If
  343. End Sub
  344. Private Sub cmdCancel_Click()
  345. On Error Resume Next
  346. Unload Me
  347. End Sub
  348. Private Sub cmdOk_Click()
  349. On Error Resume Next
  350. If Me.txtLastName = "" Then
  351.     MsgBox "User Login should not be Blank  !!", vbInformation, "User Login Error"
  352.     Exit Sub
  353. End If
  354.     mblnUpdated = True
  355. With Me
  356.     .mstrPrimaryKey = Trim(.PrimaryKey)
  357.     .mstrFirstName = Trim(.txtFirstName)
  358.     .mstrLastName = Trim(.txtLastName)
  359.     .mstrMiddleName = Trim(.txtMiddleName)
  360.     .mstrAddress = Trim(.txtAddress)
  361.     .mstrTelNo = Trim(.txtTelNo)
  362.     .mstrCellNo = Trim(.txtMobilePhoneNumber)
  363.     .mstrFaxNo = Trim(.txtFaxNo)
  364.     .mstrEmail = Trim(.txtEMail)
  365. End With
  366.     Unload Me
  367. End Sub
  368. Private Sub Form_KeyPress(KeyAscii As Integer)
  369. Select Case KeyAscii
  370.     Case vbKeyEscape
  371.         Call cmdCancel_Click
  372. End Select
  373. End Sub
  374. Private Sub Form_Load()
  375.     Me.Top = frmPhonebook.Top
  376.     Me.Left = frmPhonebook.Left
  377. End Sub
  378.